<?php defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

/* JoomLeague League Management and Prediction Game for Joomla!
 * @version $Id: PredictionSettings.class.php 1126 2008-06-09 05:45:04Z julienv $
 * @package Joomleague
 * @copyright Copyright (C) 2007  JoomLeague
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see _joomleague_license.txt
 *  
 * Homepage: http://www.joomleague.de
 * Support: htt://www.joomleague.de/forum/
 * 
 * This file is part of JoomLeague.
 *  
 * JoomLeague is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * Please note that the GPL states that any headers in files and
 * Copyright notices as well as credits in headers, source files
 * and output (screens, prints, etc.) can not be removed.
 * You can extend them with your own credits, though...
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * The "GNU General Public License" (GPL) is available at
 * http://www.gnu.org/copyleft/gpl.html.
*/ 

class JLPredictionSetting extends JLClass{
  
  var $id;
  var $project_id;
  var $joomleague_tip;
  var $mode;
  var $overview;
  var $tip_points_tip;
  var $tip_points_tip_joker;
  var $tip_points_correct_result;
  var $tip_points_correct_result_joker;
  var $tip_points_correct_diff;
  var $tip_points_correct_diff_joker;
  var $tip_points_correct_draw;
  var $tip_points_correct_draw_joker;
  var $tip_points_correct_tendence;
  var $tip_points_correct_tendence_joker;
  var $tip_points_tip_champ;
  var $tip_joker;
  var $tip_joker_limit;
  var $tip_champ;
  var $tip_admin;
  var $published;
  var $checked_out;
  var $checked_out_time;
  
  function JLPredictionSetting( &$db ) {
		$this->mosDBTable( '#__joomleague_predictiongame_project', 'id', $db );
	}
  function init(){
    
    $this->auto_approve = 0;
    $this->mode = 0;
    $this->overview = 0;
    $this->tip_points_correct_result = 7;
    $this->tip_points_correct_result_joker = 7;
    $this->tip_points_correct_diff = 5;
    $this->tip_points_correct_diff_joker = 5;
    $this->tip_points_correct_draw = 4;
    $this->tip_points_correct_draw_joker = 4;
    $this->tip_points_correct_tendence = 3;
    $this->tip_points_correct_tendence_joker = 3;
    $this->tip_points_tip_champ = 10;
    $this->tip_points_tip = 1;
    $this->tip_points_tip_joker = 1;
    $this->tip_joker = 0;
    $this->tip_joker_limit = 0;
    $this->tip_champ = 0;
    $this->tip_admin = $this->getAdmins();
    $this->published = 1;
  }
   function getAdmins() {
    $query = "SELECT user_id FROM #__joomleague_predictiongame_admins
             WHERE prediction_id = ".$this->id;
    $this->_db->setQuery($query);
    $this->tip_admin = $this->_db->loadResultArray();
  }
}

?>
